From: Florian Müllner Date: Sat, 21 Feb 2015 19:10:41 +0000 (+0100) Subject: calendar: Fix message markup getting lost X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1675 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=167610c580fc047e5e770a504de09ddb0fae7ef2;p=gnome-shell.git calendar: Fix message markup getting lost We reuse the old body text on useMarkup changes and for expanded labels. However just taking it from the label actor does not work when markup is used, as once applied it will be stripped from ClutterText:text. So to preserve markup, keep our own copy of the original string around. https://bugzilla.gnome.org/show_bug.cgi?id=744907 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index eb1dd28b5..4d4074168 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -1024,9 +1024,10 @@ const Message = new Lang.Class({ this._bodyStack.layout_manager = new LabelExpanderLayout(); contentBox.add_actor(this._bodyStack); - this.bodyLabel = new URLHighlighter(body, false, this._useBodyMarkup); + this.bodyLabel = new URLHighlighter('', false, this._useBodyMarkup); this.bodyLabel.actor.add_style_class_name('message-body'); this._bodyStack.add_actor(this.bodyLabel.actor); + this.setBody(body); this._closeButton.connect('clicked', Lang.bind(this, function() { @@ -1053,6 +1054,7 @@ const Message = new Lang.Class({ }, setBody: function(text) { + this._bodyText = text; this.bodyLabel.setMarkup(text, this._useBodyMarkup); }, @@ -1061,7 +1063,7 @@ const Message = new Lang.Class({ return; this._useBodyMarkup = enable; if (this.bodyLabel) - this.setBody(this.bodyLabel.actor.text); + this.setBody(this._bodyText); }, setActionArea: function(actor) { @@ -1101,7 +1103,7 @@ const Message = new Lang.Class({ this._actionBin.visible = (this._actionBin.get_n_children() > 0); if (this._bodyStack.get_n_children() < 2) { - let expandedLabel = new URLHighlighter(this.bodyLabel.actor.text, + let expandedLabel = new URLHighlighter(this._bodyText, true, this._useBodyMarkup); this.setExpandedBody(expandedLabel.actor); }